home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Click 1 (Special Issue) / fantasy.iso / Demo The Druid King / DemoMap.pak / SEQUENCES_S01_FIND_OGOX.VS < prev    next >
Text File  |  2001-04-11  |  2KB  |  67 lines

  1. //void
  2. //this is a side-questl; it places an additional hero who when found joins the army
  3.  
  4. NamedObj Ogox, Keltill;
  5. Conversation conv;
  6. ObjList temp;
  7. int i;
  8.  
  9.   while (EnvReadInt("/Note1") == 0) Sleep(1000); // we'll place Ogox when Keltill needs him
  10.  
  11.     Ogox = CreateNamedObj("Ogox", PlaceEx("Ogox",5800,11200, 4));
  12.     Ogox.obj.Damage(Ogox.obj.maxhealth/4);
  13.     Keltill = GetNamedObj("Keltill");
  14.     Ogox.obj.AddCommand(true, "move", point(5500, 11500));
  15.     Ogox.obj.KillCommand();
  16.  
  17.     while (1) {
  18.         if ( Dist( Keltill.obj.pos, Ogox.obj.pos) < 300 ) break;
  19.         //if ( EnvReadInt("/s01/OgoxThreadDie") == 1)    return;
  20.         Sleep(500);
  21.     }
  22.  
  23.     conv.Init("DM C18", 1, 0);
  24.     conv.Run();
  25.  
  26.     if (EnvReadString("/DM C18/Return Value") == "OgoxFight") {
  27.         temp = Keltill.obj.AsHero.army;
  28.         for (i=0; i<temp.Count(); i+=1) temp[i].SetPlayer(4);
  29.         Ogox.obj.SetPlayer(5);
  30.         PlayersAlly(4,5);
  31.         Keltill.obj.AsHero.DetachArmy();
  32.         while (1) {
  33.             if (Ogox.obj.health < Ogox.obj.maxhealth/2) break;
  34.             Sleep(300);
  35.         }
  36.         Ogox.obj.SetPlayer(1);
  37.         Sleep(200);
  38.         conv.Init("DM C19", 1, 0);
  39.         conv.Run();
  40.         if (EnvReadString("/DM C19/Return Value") == "OgoxDie") {
  41.             Ogox.obj.SetPlayer(5);
  42.             while (!Ogox.IsDead()) Sleep(500);
  43.         }
  44.         for (i=0; i<temp.Count(); i+=1) temp[i].SetPlayer(1);
  45.         AddCommandMultiple(temp, true, "attach", Keltill.obj);
  46.         KillCommandMultiple(temp);
  47.     } else {
  48.         Ogox.obj.SetPlayer(1);
  49.     }
  50.  
  51.   EnvWriteInt("/Note1",0);
  52.   if (!Ogox.IsDead()) {
  53.  
  54.         EnvWriteInt("/s01/OgoxFound", 1);
  55.         EnvWriteInt("/NewNote", 11);
  56.         Run("currentmap/mission_notes.vs");
  57.         //wait for Ogox to be healed and remove notice
  58.         while (1) {
  59.             if (Ogox.obj.health == Ogox.obj.maxhealth) {
  60.                 EnvWriteInt("/Note11", 0);
  61.                 break;
  62.             }
  63.             Sleep(1000);
  64.         }
  65.     }
  66.  
  67.